/*
	Name: 开荒
	Author: There,hello
	Date: 22-10-19 16:00
	Description: JZOJ 5908
	Algorithm: dfs序+树上差分+lca+mind
*/
#include<bits/stdc++.h>
using namespace std;
#define add(x,y) edge[++tail].ne=head[x];edge[tail].to=y;head[x]=tail;
#define lowbit(x) ((x)&(-x))
struct dd{
	int to,ne;
}edge[202020];
int head[102020],tail,n,q;
int deep[102020],dfsx_len,fir[102020],end_[102020],st[19][202020],log_[202020],mi[19];
int k[102020],tree[202020],lca_[102020];
long long sum_val[102020],val[102020];
inline int read()
{
    char ch=getchar();
    int s=0;
    while (ch<'0'||ch>'9')ch=getchar();
    while (ch>='0'&&ch<='9') {s=(s<<3)+(s<<1)+ch-'0';ch=getchar();}
    return s;
}
void update(int t,int x){
	while(t<=dfsx_len){
		tree[t]+=x;
		t+=lowbit(t);
	}
}
int sum(int t){
	int q_q=0;
	while(t){
		q_q+=tree[t];
		t-=lowbit(t);
	}
	return q_q;
}
inline int lca(int x,int y){
	int pos1=fir[x],pos2=fir[y];
	if(pos1>pos2)swap(pos2,pos1);
	int lg=log_[pos2-pos1+1];
	return deep[st[lg][pos1]]<deep[st[lg][pos2-mi[lg]+1]]?st[lg][pos1]:st[lg][pos2-mi[lg]+1];
}
void dfs(int t,int fa,long long val_){
	end_[t]=fir[t]=++dfsx_len;
	st[0][dfsx_len]=t;
	sum_val[t]=val_;
	for(int i=head[t];i;i=edge[i].ne){
		if(edge[i].to!=fa){
			deep[edge[i].to]=deep[t]+1;
			dfs(edge[i].to,t,val_+val[edge[i].to]);
			end_[t]=++dfsx_len;
			st[0][dfsx_len]=t;
		}
	}
}
void ready_st(){
	log_[0]=-1;mi[0]=1;
	for(int i=1;i<=dfsx_len;++i)log_[i]=log_[i>>1]+1;
	for(int i=1;i<=18;++i)mi[i]=mi[i-1]<<1;
	for(int i=1;i<=log_[dfsx_len];++i)
		for(int j=1;j+mi[i]-1<=dfsx_len;++j)
		st[i][j]=deep[st[i-1][j]]<deep[st[i-1][j+mi[i-1]]]?st[i-1][j]:st[i-1][j+mi[i-1]];

}
inline bool cmp(int x,int y){
	return fir[x]<fir[y];
}
int main(){
	n=read();q=read();
	for(int i=1;i<=n;++i)
	scanf("%lld",&val[i]);
	for(int i=1,x,y;i<n;++i){
		x=read();y=read();
		add(x,y);add(y,x);
	}
	dfs(1,0,val[1]);
	ready_st();
	char ch;
	for(int i=1;i<=q;++i){
		ch=getchar();
		while(ch!='Q'&&ch!='C') ch=getchar();
		if(ch=='Q'){
			int len=0;
			while(1){
				k[++len]=read();
				if(k[len]==0){
					--len;
					break;
				}
			}
			if(len==1){
				printf("%lld\n",val[k[1]]);
				continue;
			}
			sort(k+1,k+1+len,cmp);
			int Lca=k[1];
			long long ans=sum_val[k[1]]+sum(fir[k[1]]);
			for(int j=2;j<=len;++j){
				Lca=lca(Lca,k[j]);
				int lca1=lca(k[j],k[j-1]);
				ans+=sum_val[k[j]]+sum(fir[k[j]])-sum_val[lca1]-sum(fir[lca1]);
			}
			ans-=sum_val[Lca]+sum(fir[Lca])-val[Lca];
			printf("%lld\n",ans);
		}
		else {
			int x,y;
			x=read();y=read();
			update(fir[x],y-val[x]);
			update(end_[x]+1,-y+val[x]);
			val[x]=y;
		}
	}
}
